package com.yellowpage.ndc.action;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.sql.DriverManager;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.PageContext;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;

import net.sf.json.JSONObject;
import oracle.sql.DATE;

import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.struts2.ServletActionContext;
import org.springframework.orm.hibernate4.SessionFactoryUtils;

import ch.ethz.ssh2.Connection;
import ch.ethz.ssh2.SCPClient;

import com.mysql.jdbc.Statement;
import com.sun.mail.imap.protocol.Status;
import com.yellowpage.white.common.Configuration;
import com.yellowpage.white.common.Constants;
import com.yellowpage.white.common.PageRender;
import com.yellowpage.white.dao.QueryAssistantSQL;
import com.yellowpage.white.struts.BaseAction;
import com.yellowpage.white.struts.Module;
import com.yellowpage.white.struts.OperationType;
import com.yellowpage.white.util.StringUtils;
import com.yellowpage.white.util.Util4Java;
import com.yellowpage.ndc.data.ProdCustomerUid;
import com.yellowpage.ndc.data.ProdCustomer;
import com.yellowpage.ndc.data.ProdCustomerHis;
import com.yellowpage.ndc.service.ProdCustomerHisService;
import com.yellowpage.ndc.service.ProdCustomerService;
import com.yellowpage.ndc.service.ProdCustomerUidService;
import com.yellowpage.ndc.service.ProdGroupService;

import org.springframework.web.context.ContextLoaderListener;
public class ProdCustomerAction extends BaseAction {

	public String RESULT_QUERY = "query";
	public String RESULT_ADD = "add";
	public String RESULT_EDIT = "edit";
	public String RESULT_ANYUPDATE = "anyUpdate";
	public String RESULT_CUSTOMERANDUPDATE = "workLoad";
	public String RESULT_BDC = "bdc";
	

	private Configuration configuration;

	public void setConfiguration(Configuration configuration) {
		this.configuration = configuration;
	}

	private List<ProdCustomer> prodCustomerList = new ArrayList<ProdCustomer>();
	private List<Map> resultList = new ArrayList<Map>();

	private ProdCustomer prodCustomer;
	private ProdCustomerUid prodCustomerUid;
	
	private ProdCustomerService prodCustomerService;
	private ProdCustomerUidService prodCustomerUidService;
	
	
	private ProdGroupService prodGroupService;
	
	private ProdCustomerHisService prodCustomerHisService;

	private String selectedId;
	private String[] selectedIds;
	private String message;

	private String query_prodClassCode1;
	private String query_prodClassName1;
	private String query_prodClassCode2;
	private String query_prodClassName2;
	private String query_custId;
	private String query_groupId;
	private String query_name1;
	private String query_name2;
	private String query_subname1;
	private String query_subname2;
	private String query_subname3;
	private String query_subname4;
	private String query_tel;
	private String query_telExt;
	private String query_faxFlag;
	private String query_sb;
	private String query_listOrder;
	private String query_regionCode;
	private String query_regionName;
	private String query_cityCode;
	private String query_cityName;
	private String query_destrictCode;
	private String query_destrictName;
	private String query_areaCode;
	private String query_addr;
	private String query_zip;
	private String query_pyAddr;
	private String query_engAddr;
	private String query_poix;
	private String query_poiy;
	private String query_custStatus;
	private String query_custTypeCode;
	private String query_classMainId;
	private String query_orgId;
	private String query_url;
	private String query_weibo;
	private String query_weixin;
	private String query_yixin;
	private String query_logo;
	private String query_safeStatus;
	private String query_bxName;
	private String query_pyName;
	private String query_engName;
	private String query_spName;
	private String query_sourceId;
	private String query_prodClassId;
	private String query_modifyTime;
	private String query_modifyEmpId;
	private String query_inputTime;
	private String query_inputEmpId;
	private String query_id;
	private String query_source;
	private String query_inputEmpCode;
	private String query_modifyEmpCode;
	private String query_status114yp;
	private String query_status360;
	
	private String anyUpdateSelectId;
	private String[] selectedUpdate;
	
	private String query_operator;
	private String query_userName;
	private String query_startTime;
	private String query_endTime;
	
	private String query_oldTel;
	private String query_addrId;
	private String query_seqId;
	
	private String order_name1;
	private String order_tel;
	private String order_areacode;
	private String order_regioncode;
	private String order_citycode;
	private String order_addr;
	
	private static final int BUFFER_SIZE = 16 * 1024;
	private String uploadContentType;
	private String savePath;
	private File upload;
	private String uploadFileName;
	
	private Map kermanTypeMap = new HashMap();
	private Map custStustMap = new HashMap();
	public void prepare() {
		super.prepare();
		kermanTypeMap.put("0", "不上");
		kermanTypeMap.put("1", "反向");
		kermanTypeMap.put("2", "正反");
		
		custStustMap.put("99", "99");
		custStustMap.put("36", "36");
		custStustMap.put("0", "0");
		custStustMap.put("null", "为空");
		
		if (this.selectedId != null && !this.selectedId.equals("")) {
			this.prodCustomer = prodCustomerService.getProdCustomer(Long
					.parseLong(selectedId));
		}
	}

	public String queryByPage() {
		initPageRender();

		Map queryMap = new HashMap();
		queryMap.put("prodClassCode1",query_prodClassCode1);
		queryMap.put("prodClassName1",query_prodClassName1);
		queryMap.put("prodClassCode2", query_prodClassCode2);
		queryMap.put("prodClassName2",query_prodClassName2);
		queryMap.put("custId", query_custId);
		queryMap.put("groupId", query_groupId);
		queryMap.put("name1", query_name1);
		queryMap.put("name2",query_name2);
		queryMap.put("subname1", query_subname1);
		queryMap.put("subname2", query_subname2);
		queryMap.put("subname3", query_subname3);
		queryMap.put("subname4", query_subname4);
		queryMap.put("tel", query_tel);
		queryMap.put("telExt", query_telExt);
		queryMap.put("faxFlag", query_faxFlag);
		queryMap.put("sb", query_sb);
		queryMap.put("listOrder", query_listOrder);
		queryMap.put("regionCode", query_regionCode);
		queryMap.put("regionName", query_regionName);
		queryMap.put("cityCode", query_cityCode);
		queryMap.put("cityName", query_cityName);
		queryMap.put("destrictCode", query_destrictCode);
		queryMap.put("destrictName", query_destrictName);
		queryMap.put("areaCode", query_areaCode);
		queryMap.put("addr", query_addr);
		queryMap.put("zip", query_zip);
		queryMap.put("pyAddr", query_pyAddr);
		queryMap.put("engAddr", query_engAddr);
		queryMap.put("poix", query_poix);
		queryMap.put("poiy", query_poiy);
		queryMap.put("custStatus", query_custStatus);
		queryMap.put("custTypeCode", query_custTypeCode);
		queryMap.put("classMainId", query_classMainId);
		queryMap.put("orgId", query_orgId);
		queryMap.put("url", query_url);
		queryMap.put("weibo", query_weibo);
		queryMap.put("weixin", query_weixin);
		queryMap.put("yixin", query_yixin);
		queryMap.put("logo", query_logo);
		queryMap.put("safeStatus", query_safeStatus);
		queryMap.put("bxName", query_bxName);
		queryMap.put("pyName", query_pyName);
		queryMap.put("engName", query_engName);
		queryMap.put("spName", query_spName);
		queryMap.put("sourceId", query_sourceId);
		queryMap.put("prodClassId", query_prodClassId);
		queryMap.put("modifyTime", query_modifyTime);
		queryMap.put("modifyEmpId", query_modifyEmpId);
		queryMap.put("inputTime", query_inputTime);
		queryMap.put("inputEmpId", query_inputEmpId);
		queryMap.put("id", query_id);
		queryMap.put("source", query_source);
		queryMap.put("inputEmpCode", query_inputEmpCode);
		queryMap.put("modifyEmpCode", query_modifyEmpCode);
		queryMap.put("status114yp", query_status114yp);
		queryMap.put("status360", query_status360);

		queryMap.put("ordername1", order_name1);
		queryMap.put("ordertel", order_tel);
		queryMap.put("orderareacode", order_areacode);
		queryMap.put("orderregioncode", order_regioncode);
		queryMap.put("ordercitycode", order_citycode);
		queryMap.put("orderaddr", order_addr);

		resultList = prodCustomerService.queryProdCustomerByPage(queryMap,
				pageRender);

		setPageRenderToRequest();
		
		//setPageRenderToRequestNoCount();

		return RESULT_QUERY;
	}
	
	public String queryWorkload(){
		initPageRender();


		Map queryMap = new HashMap();
		queryMap.put("operator",query_operator);
		queryMap.put("userName",query_userName);
		queryMap.put("startTime",query_startTime);
		queryMap.put("endTime", query_endTime);
		resultList = prodCustomerService.queryProdWorkload(queryMap,
				pageRender);

		
		setPageRenderToRequestNoCount();
		return RESULT_CUSTOMERANDUPDATE;
	}
	
	

	public void count() throws Exception {  
		    

		Map queryMap = new HashMap();
		queryMap.put("prodClassCode1",query_prodClassCode1);
		queryMap.put("prodClassName1",query_prodClassName1);
		queryMap.put("prodClassCode2", query_prodClassCode2);
		queryMap.put("prodClassName2",query_prodClassName2);
		queryMap.put("custId", query_custId);
		queryMap.put("groupId", query_groupId);
		queryMap.put("name1", query_name1);
		queryMap.put("name2",query_name2);
		queryMap.put("subname1", query_subname1);
		queryMap.put("subname2", query_subname2);
		queryMap.put("subname3", query_subname3);
		queryMap.put("subname4", query_subname4);
		queryMap.put("tel", query_tel);
		queryMap.put("telExt", query_telExt);
		queryMap.put("faxFlag", query_faxFlag);
		queryMap.put("sb", query_sb);
		queryMap.put("listOrder", query_listOrder);
		queryMap.put("regionCode", query_regionCode);
		queryMap.put("regionName", query_regionName);
		queryMap.put("cityCode", query_cityCode);
		queryMap.put("cityName", query_cityName);
		queryMap.put("destrictCode", query_destrictCode);
		queryMap.put("destrictName", query_destrictName);
		queryMap.put("areaCode", query_areaCode);
		queryMap.put("addr", query_addr);
		queryMap.put("zip", query_zip);
		queryMap.put("pyAddr", query_pyAddr);
		queryMap.put("engAddr", query_engAddr);
		queryMap.put("poix", query_poix);
		queryMap.put("poiy", query_poiy);
		queryMap.put("custStatus", query_custStatus);
		queryMap.put("custTypeCode", query_custTypeCode);
		queryMap.put("classMainId", query_classMainId);
		queryMap.put("orgId", query_orgId);
		queryMap.put("url", query_url);
		queryMap.put("weibo", query_weibo);
		queryMap.put("weixin", query_weixin);
		queryMap.put("yixin", query_yixin);
		queryMap.put("logo", query_logo);
		queryMap.put("safeStatus", query_safeStatus);
		queryMap.put("bxName", query_bxName);
		queryMap.put("pyName", query_pyName);
		queryMap.put("engName", query_engName);
		queryMap.put("spName", query_spName);
		queryMap.put("sourceId", query_sourceId);
		queryMap.put("prodClassId", query_prodClassId);
		queryMap.put("modifyTime", query_modifyTime);
		queryMap.put("modifyEmpId", query_modifyEmpId);
		queryMap.put("inputTime", query_inputTime);
		queryMap.put("inputEmpId", query_inputEmpId);
		queryMap.put("id", query_id);
		queryMap.put("source", query_source);
		queryMap.put("inputEmpCode", query_inputEmpCode);
		queryMap.put("modifyEmpCode", query_modifyEmpCode);
		queryMap.put("status114yp", query_status114yp);
		queryMap.put("status360", query_status360);

		HttpServletResponse response = ServletActionContext.getResponse(); 
		response.setContentType("text/xml; charset=utf-8");
		response.setCharacterEncoding("utf-8");
	    PrintWriter out = response.getWriter();
	    resultList = prodCustomerService.countProdCustomer(queryMap);
	    try {
	    	if(resultList != null){
	    		 out.print("总共"+resultList.get(0).get("TOTAL")+"条");
	    	}else{
	    		out.print("总共0条");
	    	}
	    	
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
			out.print("");
		}
		out.flush();
		out.close();
			
		
	}
	
	public String BDCByPage(){
		
		return RESULT_BDC;
	}
	
	public String queryBDCByPage(){
		initPageRender();

		Map queryMap = new HashMap();
		queryMap.put("prodClassCode1",query_prodClassCode1);
		queryMap.put("prodClassName1",query_prodClassName1);
		queryMap.put("prodClassCode2", query_prodClassCode2);
		queryMap.put("prodClassName2",query_prodClassName2);
		queryMap.put("custId", query_custId);
		queryMap.put("groupId", query_groupId);
		queryMap.put("name1", query_name1);
		queryMap.put("name2",query_name2);
		
		
		queryMap.put("tel", query_tel);
		queryMap.put("telExt", query_telExt);

		queryMap.put("listOrder", query_listOrder);
		queryMap.put("regionCode", query_regionCode);
		queryMap.put("regionName", query_regionName);
		queryMap.put("cityCode", query_cityCode);
		queryMap.put("cityName", query_cityName);
		queryMap.put("destrictCode", query_destrictCode);
		queryMap.put("destrictName", query_destrictName);
		
		queryMap.put("areaCode", query_areaCode);
		queryMap.put("addr", query_addr);
		queryMap.put("zip", query_zip);

		queryMap.put("engAddr", query_engAddr);
		queryMap.put("poix", query_poix);
		queryMap.put("poiy", query_poiy);
		queryMap.put("custStatus", query_custStatus);
		queryMap.put("custTypeCode", query_custTypeCode);
		queryMap.put("classMainId", query_classMainId);
		queryMap.put("orgId", query_orgId);
		queryMap.put("url", query_url);
		queryMap.put("weibo", query_weibo);
		queryMap.put("weixin", query_weixin);
		queryMap.put("yixin", query_yixin);
		queryMap.put("logo", query_logo);
		queryMap.put("safeStatus", query_safeStatus);
		queryMap.put("source", query_source);
		
		
		
		queryMap.put("oldTel", query_oldTel);
		queryMap.put("addrId", query_addrId);
		queryMap.put("seqId", query_seqId);
		

		resultList = prodCustomerService.queryProdCustomerBDCByPage(queryMap,
				pageRender);

		setPageRenderToRequest();
		
		return RESULT_BDC;
	}
	
	public String exportExcel() {
		Map queryMap = new HashMap();
		queryMap.put("prodClassCode1", query_prodClassCode1);
		queryMap.put("prodClassName1", query_prodClassName1);
		queryMap.put("prodClassCode2", query_prodClassCode2);
		queryMap.put("prodClassName2", query_prodClassName2);
		queryMap.put("custId", query_custId);
		queryMap.put("groupId", query_groupId);
		queryMap.put("name1", query_name1);
		queryMap.put("name2", query_name2);
		queryMap.put("tel", query_tel);
		queryMap.put("telExt", query_telExt);
		queryMap.put("listOrder", query_listOrder);
		queryMap.put("regionCode", query_regionCode);
		queryMap.put("regionName", query_regionName);
		queryMap.put("cityCode", query_cityCode);
		queryMap.put("cityName", query_cityName);
		queryMap.put("addr", query_addr);
		queryMap.put("zip", query_zip);
		queryMap.put("custStatus", query_custStatus);
		queryMap.put("url", query_url);
		queryMap.put("weibo", query_weibo);
		queryMap.put("weixin", query_weixin);
		queryMap.put("yixin", query_yixin);
		queryMap.put("source", query_source);
		queryMap.put("modifyTime", query_modifyTime);
		queryMap.put("inputEmpCode", query_inputEmpCode);
		queryMap.put("inputTime", query_inputTime);
		queryMap.put("modifyEmpCode", query_modifyEmpCode);
	
		
		resultList = prodCustomerService.ProdCustomerexcel(queryMap);
	
		
			HttpServletResponse response = ServletActionContext.getResponse();
			response.setContentType("aprodGroupServicepplication/x-download");
			OutputStream outp = null;		
			response.addHeader("Content-Disposition", "attachment;filename="
					+ "ProdCustomer.xls");
			
			try {
			outp = response.getOutputStream();
			
			
			HSSFWorkbook workbook = new HSSFWorkbook();
			
			HSSFSheet sheet = workbook.createSheet("ProdCustomer");	
			sheet.setDefaultColumnWidth(15);


			HSSFRow row = sheet.createRow(0);		
			 
			row.createCell(0).setCellValue("一级分类编号 ");	
			row.createCell(1).setCellValue("一级分类名称 ");
			row.createCell(2).setCellValue("二级分类编号 ");
			row.createCell(3).setCellValue("二级分类名称 ");
			row.createCell(4).setCellValue("客户编号 ");
			row.createCell(5).setCellValue("品牌编号 ");
			row.createCell(6).setCellValue("客户名称1 ");
			row.createCell(7).setCellValue("客户名称2");
			row.createCell(8).setCellValue("电话");
			row.createCell(9).setCellValue("分机");
			row.createCell(10).setCellValue("列名次序");
			row.createCell(11).setCellValue("地区代码");
			row.createCell(12).setCellValue("地区名称");
			row.createCell(13).setCellValue("城市代码");
			row.createCell(14).setCellValue("城市名称");
			row.createCell(15).setCellValue("地址");
			row.createCell(16).setCellValue("邮编");
			row.createCell(17).setCellValue("客户状态");
			row.createCell(18).setCellValue("Url");
			row.createCell(19).setCellValue("微博");
			row.createCell(20).setCellValue("微信");	
			row.createCell(21).setCellValue("易信");
			row.createCell(22).setCellValue("来源");
			row.createCell(23).setCellValue("修改时间");
			row.createCell(24).setCellValue("修改人");
			row.createCell(25).setCellValue("输入时间");
			row.createCell(26).setCellValue("输入人 ");
			
			
			
			for (int i = 0; i < resultList.size(); i++) {
			
				HSSFRow data_row = sheet.createRow(i+1);			
			   Map result = (Map)resultList.get(i);	 		 
				data_row.createCell(0).setCellValue(result.get("PROD_CLASS_CODE1")!=null?result.get("PROD_CLASS_CODE1").toString():"");					
				data_row.createCell(1).setCellValue(result.get("PROD_CLASS_NAME1")!=null?result.get("PROD_CLASS_NAME1").toString():"");
				data_row.createCell(2).setCellValue(result.get("PROD_CLASS_CODE2")!=null?result.get("PROD_CLASS_CODE2").toString():"");
				data_row.createCell(3).setCellValue(result.get("PROD_CLASS_NAME2")!=null?result.get("PROD_CLASS_NAME2").toString():"");
				data_row.createCell(4).setCellValue(result.get("CUST_ID")!=null?result.get("CUST_ID").toString():"");
				data_row.createCell(5).setCellValue(result.get("GROUP_ID")!=null?result.get("GROUP_ID").toString():"");
				data_row.createCell(6).setCellValue(result.get("NAME1")!=null?result.get("NAME1").toString():"");
				data_row.createCell(7).setCellValue(result.get("NAME2")!=null?result.get("NAME2").toString():"");
				data_row.createCell(8).setCellValue(result.get("TEL")!=null?result.get("TEL").toString():"");
				data_row.createCell(9).setCellValue(result.get("TEL_EXT")!=null?result.get("TEL_EXT").toString():"");		
				data_row.createCell(10).setCellValue(result.get("LIST_ORDER")!=null?result.get("LIST_ORDER").toString():"");
				data_row.createCell(11).setCellValue(result.get("REGION_CODE")!=null?result.get("REGION_CODE").toString():"");
				data_row.createCell(12).setCellValue(result.get("REGION_NAME")!=null?result.get("REGION_NAME").toString():"");
				data_row.createCell(13).setCellValue(result.get("CITY_CODE")!=null?result.get("CITY_CODE").toString():"");
				data_row.createCell(14).setCellValue(result.get("CITY_NAME")!=null?result.get("CITY_NAME").toString():"");
				data_row.createCell(15).setCellValue(result.get("ADDR")!=null?result.get("ADDR").toString():"");
				data_row.createCell(16).setCellValue(result.get("ZIP")!=null?result.get("ZIP").toString():"");
				data_row.createCell(17).setCellValue(result.get("CUST_STATUS")!=null?result.get("CUST_STATUS").toString():"");
				data_row.createCell(18).setCellValue(result.get("URL")!=null?result.get("URL").toString():"");
				data_row.createCell(19).setCellValue(result.get("WEIBO")!=null?result.get("WEIBO").toString():"");		
				data_row.createCell(20).setCellValue(result.get("WEIXIN")!=null?result.get("WEIXIN").toString():"");
				data_row.createCell(11).setCellValue(result.get("YIXIN")!=null?result.get("YIXIN").toString():"");
				data_row.createCell(22).setCellValue(result.get("SOURCE")!=null?result.get("SOURCE").toString():"");
				data_row.createCell(23).setCellValue(result.get("MODIFY_TIME")!=null?result.get("MODIFY_TIME").toString():"");
				data_row.createCell(24).setCellValue(result.get("MODIFY_EMP_CODE")!=null?result.get("MODIFY_EMP_CODE").toString():"");
				data_row.createCell(25).setCellValue(result.get("INPUT_TIME")!=null?result.get("INPUT_TIME").toString():"");
				data_row.createCell(26).setCellValue(result.get("INPUT_EMP_CODE")!=null?result.get("INPUT_EMP_CODE").toString():"");
				
				}					
			workbook.write(outp);			
				response.flushBuffer();
				outp.flush(); 
				response.reset();
			} catch (Exception e) {
				
				log.error(e.getMessage(), e);
				this.addActionError("** 生成文件错误 !");
			} finally {
				if (outp != null) {
					try {
						 
						outp.close();
					} catch (IOException e) {
						log.error(e.getMessage(), e);
					}
				}
			}
			return RESULT_QUERY;
			
		}	
	
	public String toAdd() {
		return RESULT_ADD;
	}

	public String save()throws IOException {
		ProdCustomerUid prodCustomerUid = prodCustomerUidService.getProdCustomerUid((long) 1);
		
		
		String custId = prodCustomerService.getCustId();
		custId = String.valueOf((Integer.valueOf(custId)).intValue() + 1);
		
		int j = 8 - custId.length();
		for (int i = 0; i < j; i++) {
			custId =  "0" + custId;
		}
		
		
		prodCustomer.setCustId("OF" + prodCustomer.getRegionCode().substring(0, 4) + custId);
		
		String custIdHis = "OF" + prodCustomer.getRegionCode().substring(0, 4) + custId;
		
		if(!prodCustomer.getGroupId().equals("")){
			if(prodCustomerService.getGroupIdExists(prodCustomer.getGroupId())){
				prodCustomer.setGroupId(prodCustomer.getGroupId());
			} else {
				message = "新增失败!不存在" + prodCustomer.getGroupId() + "此品牌编号!";
				return RESULT_ADD;
			}
		}
		
		String regionName = prodGroupService.getRegionByCode(prodCustomer.getRegionCode());
		prodCustomer.setRegionName(regionName);
		prodCustomer.setRegionCode(prodCustomer.getRegionCode());
		
		prodCustomer.setInputEmpId(Integer.valueOf(loginUser.getUserId().toString()));
		prodCustomer.setInputTime(new Date());
		 //根据服务器的文件保存地址和原文件名创建目录文件全路径
	
		System.out.print(this.getSavePath());
		log.error("path is" + ServletActionContext.getServletContext().getRealPath(this.getSavePath()) + "\\" + this.getUploadFileName());        
		log.error("uploadFileName is " + this.getUploadFileName());
		log.error("uploadContentType is " + this.getUploadContentType());
		
        String dstPath = ServletActionContext.getServletContext().getRealPath(this.getSavePath()) + "\\" + this.getUploadFileName();  
        System.out.print("dstPath is " + dstPath);
        File dstFile = new File(dstPath); 
        
        if (this.getUploadFileName() != null){
        	log.error("填了logo");
				copy(this.upload, dstFile);
		        
		        Connection conn = new Connection("101.227.246.1");
				conn.connect();
			
				boolean isAuthenticated = conn.authenticateWithPassword("xujing", "hB#118114$123@");
				if (isAuthenticated == false){
					throw new IOException("Authentication failed.");
				}		        
				SCPClient scpClient = conn.createSCPClient();

				scpClient.put(dstPath, ("OF" + prodCustomer.getRegionCode().substring(0, 4) + custId) + ".png", "/home/web/icon/omc/", "0644");	

				prodCustomer.setLogo("/icon/omc/" + ("OF" + prodCustomer.getRegionCode().substring(0, 4) + custId) + ".png");
      	
        }
        prodCustomer.setCustStatus((byte) 0);
        prodCustomer.setListOrder(99);
		prodCustomerService.saveProdCustomer(prodCustomer);
		
		
		String coustomerId = prodCustomerService.getIdBycustId(custIdHis);
		
		/*保存customerUid表对应数据 start*/
		ProdCustomerUid customeruid = new ProdCustomerUid();
		
		String pyname = StringUtils.getJianPinOfName(prodCustomer.getName1());
		customeruid.setId(Long.parseLong(coustomerId));
		customeruid.setSpName(pyname);
		customeruid.setT9Name(StringUtils.getNumFromLetter(pyname));
		//prodCustomerUidService.saveProdCustomerUid(customeruid);
		
		
		/*保存customerUid表对应数据 end*/
		
		// 记录操作记录
		
		
		if(!coustomerId.isEmpty()){
			
			ProdCustomerHis prodcustomerhis = new ProdCustomerHis();
			prodcustomerhis.setContent("id："+coustomerId);
			prodcustomerhis.setCustomerId(Integer.parseInt(coustomerId));
			prodcustomerhis.setCreateUser(Integer.valueOf(loginUser.getUserId().toString()));
			prodcustomerhis.setType(0);
			prodcustomerhis.setCreateTime(new Date());
			prodCustomerHisService.saveProdCustomerHis(prodcustomerhis);
			
			
		}
		

		message = "新增成功!";
		return RESULT_ADD;
	}
	private static void copy(File src, File dst) {  
        InputStream in = null;  
        OutputStream out = null;  
        try {  
            in = new BufferedInputStream(new FileInputStream(src), BUFFER_SIZE);  
            out = new BufferedOutputStream(new FileOutputStream(dst),  
                    BUFFER_SIZE);  
            byte[] buffer = new byte[BUFFER_SIZE];  
            int len = 0;  
            while ((len = in.read(buffer)) > 0) {  
                out.write(buffer, 0, len);  
            }  
        } catch (Exception e) {  
            e.printStackTrace();  
        } finally {  
            if (null != in) {  
                try {  
                    in.close();  
                } catch (IOException e) {  
                    e.printStackTrace();  
                }  
            }  
            if (null != out) {  
                try {  
                    out.close();  
                } catch (IOException e) {  
                    e.printStackTrace();  
                }  
            }  
        }  
    }
	public void validateSave() {
		if (prodCustomer.getProdClassCode1().length() == 0) {
			this.addActionError("** 一级分类编号 不能为空 !");
		}
		if (prodCustomer.getProdClassCode2().length() == 0) {
			this.addActionError("** 二级分类编号 不能为空 !");
		}
/*		if (prodCustomer.getGroupId().length() == 0) {
			this.addActionError("** GroupId 不能为空 !");
		}*/
		if (prodCustomer.getName1().length() == 0) {
			this.addActionError("** 品牌名称1 不能为空 !");
		}
		if (prodCustomer.getTel().length() == 0) {
			this.addActionError("** 电话 不能为空 !");
		}
		if (prodCustomer.getRegionCode().length() <4) {
			this.addActionError("** 地区代码 不能小于4位 !");
		}
		if (prodCustomer.getCityCode().length() == 0) {
			this.addActionError("** 城市代码 不能为空 !");
		}
		if (prodCustomer.getDestrictCode().length() == 0) {
			this.addActionError("** 区代码 不能为空 !");
		}
/*		if (prodCustomer.getListOrder() == null) {
			this.addActionError("** 列名次序 不能为空 !");
		}*/
		
		this.setValidatorResult("/ndc/ProdCustomerAdd.jsp");
	}

	public String toEdit() {
		Long id = new Long(selectedId);

		prodCustomer = prodCustomerService.getProdCustomer(id);

		prodCustomerUid = prodCustomerUidService.getProdCustomerUid(id);
		
		return RESULT_EDIT;
	}

	public String update()throws IOException {
		if(!prodCustomer.getGroupId().equals("")){
			if(!prodCustomerService.getGroupIdExists(prodCustomer.getGroupId())){
				message = "修改失败!不存在" + prodCustomer.getGroupId() + "此品牌编号!";
				return RESULT_EDIT;
			}
		}
		
		
	
		String custId = prodCustomerService.getCustId();
		
		String content = "";
		
		String regionName = prodGroupService.getRegionByCode(prodCustomer.getRegionCode());
		prodCustomer.setRegionName(regionName);
		System.out.print(this.getSavePath());
		prodCustomer.setModifyTime(new Date());
		prodCustomer.setModifyEmpId(Integer.valueOf(loginUser.getUserId().toString()));
		if (this.getUploadFileName() != null){
	   		 //根据服务器的文件保存地址和原文件名创建目录文件全路径
	   		log.error("path" + ServletActionContext.getServletContext().getRealPath(this.getSavePath()) + "\\" + this.getUploadFileName());        
	   		log.error("uploadFileName is " + this.getUploadFileName());
	   		log.error("uploadContentType is " + this.getUploadContentType());
   		
	   		String dstPath = ServletActionContext.getServletContext().getRealPath(this.getSavePath()) + "\\" + this.getUploadFileName();  
	   		File dstFile = new File(dstPath); 
        	log.error("填了logo");
				copy(this.upload, dstFile);
		        
		        Connection conn = new Connection("101.227.246.1");
				conn.connect();
				
				boolean isAuthenticated = conn.authenticateWithPassword("xujing", "hB#118114$123@");
				if (isAuthenticated == false){
					throw new IOException("Authentication failed.");
				}
		        
				SCPClient scpClient = conn.createSCPClient();
				scpClient.put(dstPath, prodCustomer.getCustId() + ".png", "/home/web/icon/omc/", "0644");	
				
				prodCustomer.setLogo("/icon/omc/" + prodCustomer.getCustId() + ".png");
        }
		
		//记录修改操作记录
		
		
		ProdCustomer customerData = prodCustomerService.getProdCustomer(prodCustomer.getId());
		
		JSONObject obj1 = JSONObject.fromObject(customerData);
		
		JSONObject obj2 = JSONObject.fromObject(prodCustomer);
		
		for(int i=0;i<obj2.names().size();i++){
			
			if(obj1.names().get(i).equals("modifyTime") || obj1.names().get(i).equals("inputTime")){
				
				continue;
			}
			
			if(!obj1.get(obj1.names().get(i)).equals(obj2.get(obj1.names().get(i)))){
				
				content+=obj1.get(obj1.names().get(i))+"-->"+obj2.get(obj1.names().get(i))+",";
				
			}
		}
		
		ProdCustomerHis prodcustomerhis = new ProdCustomerHis();
		prodcustomerhis.setContent(content);
		prodcustomerhis.setCustomerId(Integer.valueOf(prodCustomer.getId().toString()));
		prodcustomerhis.setCreateUser(Integer.valueOf(loginUser.getUserId().toString()));
		prodcustomerhis.setType(1);
		prodcustomerhis.setCreateTime(new Date());
		prodCustomerHisService.saveProdCustomerHis(prodcustomerhis);
	
		// end 记录修改操作记录
		
		
		/* 修改名称的首拼和t9 start*/
		ProdCustomerUid customeruid = new ProdCustomerUid(); 
		String pyname = StringUtils.getJianPinOfName(prodCustomer.getName1());
		customeruid.setId(prodCustomer.getId());
		customeruid.setSpName(pyname);
		customeruid.setT9Name(StringUtils.getNumFromLetter(pyname));
		ProdCustomerUid prodCustomerUid = prodCustomerUidService.getProdCustomerUid(prodCustomer.getId());
		if(prodCustomerUid!=null){
			//prodCustomerUidService.updateProdCustomerUid(customeruid);
		}else{
			//prodCustomerUidService.saveProdCustomerUid(customeruid);
		}
		
		/* 修改名称的首拼和t9 end*/
		
		prodCustomerService.updateProdCustomer(prodCustomer);

		message = "修改成功!";

		
		return RESULT_EDIT;
	}
	
	
	
	

	public void validateUpdate() {
		if (prodCustomer.getProdClassCode1().length() == 0) {
			this.addActionError("** 一级分类编号 不能为空 !");
		}
		if (prodCustomer.getProdClassCode2().length() == 0) {
			this.addActionError("** 二级分类编号 不能为空 !");
		}
		if (prodCustomer.getCustId().length() == 0) {
			this.addActionError("** 客户编号 不能为空 !");
		}
/*		if (prodCustomer.getGroupId().length() == 0) {
			this.addActionError("** GroupId 不能为空 !");
		}*/
		if (prodCustomer.getName1().length() == 0) {
			this.addActionError("** 客户名称1 不能为空 !");
		}
		if (prodCustomer.getTel().length() == 0) {
			this.addActionError("** 电话 不能为空 !");
		}
/*		if (prodCustomer.getRegionCode().length() == 0) {
			this.addActionError("** RegionCode 不能为空 !");
		}*/
		if (prodCustomer.getRegionCode().length() < 5) {
			this.addActionError("** 地区代码 不能小于4 !");
		}
		if (prodCustomer.getCityCode().length() == 0) {
			this.addActionError("** 城市代码 不能为空 !");
		}
		if (prodCustomer.getDestrictCode().length() == 0) {
			this.addActionError("** 区域代码 不能为空 !");
		}
/*		if (prodCustomer.getListOrder() == null) {
			this.addActionError("** 列名次序 不能为空 !");
		}*/
		
		this.setValidatorResult("/ndc/ProdCustomerUpdate.jsp");
	}

	public String delete() {
		if(!selectedIds.equals("")){
			for (String id : selectedIds) {
				Long customerId = new Long(id);
				prodCustomer = prodCustomerService.getProdCustomer(customerId);
				prodCustomer.setCustStatus(Byte.parseByte("99"));
				prodCustomer.setGroupId("");
				prodCustomer.setModifyTime(new Date());
				prodCustomer.setModifyEmpId(Integer.valueOf(loginUser.getUserId().toString()));
				prodCustomerService.updateProdCustomer(prodCustomer);
				
				//记录删除操作日志
				ProdCustomerHis prodcustomerhis = new ProdCustomerHis();
				prodcustomerhis.setContent(" 标记 custStatus：99");
				prodcustomerhis.setCustomerId(Integer.valueOf(prodCustomer.getId().toString()));
				prodcustomerhis.setCreateUser(Integer.valueOf(loginUser.getUserId().toString()));
				prodcustomerhis.setType(2);
				prodcustomerhis.setCreateTime(new Date());
				prodCustomerHisService.saveProdCustomerHis(prodcustomerhis);
			}
		}
		return queryByPage();
	}
	
	public String deleteisflase() {
		if(!selectedIds.equals("")){
			for (String id : selectedIds) {
				Long customerId = new Long(id);
				prodCustomer = prodCustomerService.getProdCustomer(customerId);
				prodCustomer.setCustStatus(Byte.parseByte("0"));
				prodCustomer.setModifyTime(new Date());
				prodCustomer.setModifyEmpId(Integer.valueOf(loginUser.getUserId().toString()));
				prodCustomerService.updateProdCustomer(prodCustomer);
				
				//记录删除操作日志
				ProdCustomerHis prodcustomerhis = new ProdCustomerHis();
				prodcustomerhis.setContent(" set custStatus： 0");
				prodcustomerhis.setCustomerId(Integer.valueOf(prodCustomer.getId().toString()));
				prodcustomerhis.setCreateUser(Integer.valueOf(loginUser.getUserId().toString()));
				prodcustomerhis.setType(4);
				prodcustomerhis.setCreateTime(new Date());
				prodCustomerHisService.saveProdCustomerHis(prodcustomerhis);
			}
		}
		return queryByPage();
	}
	

	public String down() {
		if(!selectedIds.equals("")){
			for (String id : selectedIds) {
				Long customerId = new Long(id);
				prodCustomer = prodCustomerService.getProdCustomer(customerId);
				prodCustomer.setCustStatus(Byte.parseByte("36"));
				prodCustomerService.updateProdCustomer(prodCustomer);
				
				//记录删除操作日志
				ProdCustomerHis prodcustomerhis = new ProdCustomerHis();
				prodcustomerhis.setContent("set custStatus： 36");
				prodcustomerhis.setCustomerId(Integer.valueOf(prodCustomer.getId().toString()));
				prodcustomerhis.setCreateUser(Integer.valueOf(loginUser.getUserId().toString()));
				prodcustomerhis.setType(3);
				prodcustomerhis.setCreateTime(new Date());
				prodCustomerHisService.saveProdCustomerHis(prodcustomerhis);
			}
		}
		return queryByPage();
	}
	/*批量修改*/
	public String anyUpdate(){
		if(!selectedIds.equals("")){
			Long id=new Long(selectedIds[0].toString());
			if(id!=null){
				anyUpdateSelectId="";
				for(int i = 0;i<selectedIds.length;i++){
					anyUpdateSelectId+=selectedIds[i]+",";  
					}
				prodCustomer = prodCustomerService.getProdCustomer(id);
			}
		}
		
		return RESULT_ANYUPDATE;	
	}
	/*批量修改*/
	public String toAnyUpdate(){
		
		boolean flag = false;
		if(!anyUpdateSelectId.equals("")){
			System.out.println(anyUpdateSelectId);
			String[] anySelectId=anyUpdateSelectId.split(",");
			
			if(!anySelectId.equals("") && anySelectId!=null){
				if(selectedUpdate!=null){
					for (String id : anySelectId) {
						ProdCustomer Customer = prodCustomerService.getProdCustomer(new Long(id));
						
						String content = "";
						
						if(Customer!=null){
							for(int i=0;i<selectedUpdate.length;i++){
								if(selectedUpdate[i].equals("1")){
									content+=Customer.getProdClassCode1()+"-->"+prodCustomer.getProdClassCode1();
									Customer.setProdClassCode1(prodCustomer.getProdClassCode1());
									
								}
								if(selectedUpdate[i].equals("2")){
									content+=Customer.getProdClassCode2()+"-->"+prodCustomer.getProdClassCode2();
									Customer.setProdClassCode2(prodCustomer.getProdClassCode2());
									
								}
								if(selectedUpdate[i].equals("3")){
									content+=Customer.getName1()+"-->"+prodCustomer.getName1();
									Customer.setName1(prodCustomer.getName1());
									flag = true;
									
								}
								if(selectedUpdate[i].equals("4")){
									content+=Customer.getName2()+"-->"+prodCustomer.getName2();
									Customer.setName2(prodCustomer.getName2());
									
									
								}
								if(selectedUpdate[i].equals("5")){
									content+=Customer.getAreaCode()+"-->"+prodCustomer.getAreaCode();
									Customer.setAreaCode(prodCustomer.getAreaCode());
									
									
								}
								if(selectedUpdate[i].equals("6")){
									content+=Customer.getRegionCode()+"-->"+prodCustomer.getRegionCode();
									Customer.setRegionCode(prodCustomer.getRegionCode());
									
									
								}
								if(selectedUpdate[i].equals("7")){
									content+=Customer.getCityCode()+"-->"+prodCustomer.getCityCode();
									Customer.setCityCode(prodCustomer.getCityCode());
									
									
								}
								if(selectedUpdate[i].equals("8")){
									content+=Customer.getCityName()+"-->"+prodCustomer.getCityName();
									Customer.setCityName(prodCustomer.getCityName());
									
									
									
								}
								if(selectedUpdate[i].equals("9")){
									content+=Customer.getDestrictCode()+"-->"+prodCustomer.getDestrictCode();
									Customer.setDestrictCode(prodCustomer.getDestrictCode());
									
								}
								if(selectedUpdate[i].equals("10")){
									content+=Customer.getDestrictName()+"-->"+prodCustomer.getDestrictName();
									Customer.setDestrictName(prodCustomer.getDestrictName());
									
								}
							}
						}
						
						Customer.setModifyTime(new Date());
						Customer.setModifyEmpId(Integer.valueOf(loginUser.getUserId().toString()));

						
						
						//记录删除操作日志
						ProdCustomerHis prodcustomerhis = new ProdCustomerHis();
						prodcustomerhis.setContent(content);
						prodcustomerhis.setCustomerId(Integer.valueOf(prodCustomer.getId().toString()));
						prodcustomerhis.setCreateUser(Integer.valueOf(loginUser.getUserId().toString()));
						prodcustomerhis.setType(1);
						prodcustomerhis.setCreateTime(new Date());
						prodCustomerHisService.saveProdCustomerHis(prodcustomerhis);
						
						prodCustomerService.updateProdCustomer(Customer);
						
						/* 修改名称的首拼和t9 start*/
						if(flag){
						
							ProdCustomerUid customeruid = new ProdCustomerUid(); 
							String pyname = StringUtils.getJianPinOfName(prodCustomer.getName1());
							customeruid.setId(prodCustomer.getId());
							customeruid.setSpName(pyname);
							customeruid.setT9Name(StringUtils.getNumFromLetter(pyname));
							ProdCustomerUid prodCustomerUid = prodCustomerUidService.getProdCustomerUid(prodCustomer.getId());
							if(prodCustomerUid!=null){
								//prodCustomerUidService.updateProdCustomerUid(customeruid);
							}else{
								//prodCustomerUidService.saveProdCustomerUid(customeruid);
							}
							
						
							}
						
						/* 修改名称的首拼和t9 end*/
						
						
						
					}
					
				}
			
			}
		}
		
		
		message = "修改成功!";
		return RESULT_ANYUPDATE;
	}
	
	
	/**
	 * getters and setters
	 * 
	 * @return
	 */
	public void setProdCustomer(ProdCustomer prodCustomer) {
		this.prodCustomer = prodCustomer;
	}

	public ProdCustomer getProdCustomer() {
		return prodCustomer;
	}

	public void setProdCustomerService(ProdCustomerService prodCustomerService) {
		this.prodCustomerService = prodCustomerService;
	}

	public List<ProdCustomer> getProdCustomerList() {
		return prodCustomerList;
	}

	public void setProdCustomerList(List<ProdCustomer> prodCustomerList) {
		this.prodCustomerList = prodCustomerList;
	}

	public String getSelectedId() {
		return selectedId;
	}

	public void setSelectedId(String selectedId) {
		this.selectedId = selectedId;
	}

	public String[] getSelectedIds() {
		return selectedIds;
	}

	public void setSelectedIds(String[] selectedIds) {
		this.selectedIds = selectedIds;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public List<Map> getResultList() {
		return resultList;
	}

	public void setResultList(List<Map> resultList) {
		this.resultList = resultList;
	}

	public String getQuery_prodClassCode1() {
		return this.query_prodClassCode1;
	}

	public void setQuery_prodClassCode1(String prodClassCode1) {
		this.query_prodClassCode1 = prodClassCode1;
	}

	public String getQuery_prodClassName1() {
		return this.query_prodClassName1;
	}

	public void setQuery_prodClassName1(String prodClassName1) {
		this.query_prodClassName1 = prodClassName1;
	}

	public String getQuery_prodClassCode2() {
		return this.query_prodClassCode2;
	}

	public void setQuery_prodClassCode2(String prodClassCode2) {
		this.query_prodClassCode2 = prodClassCode2;
	}

	public String getQuery_prodClassName2() {
		return this.query_prodClassName2;
	}

	public void setQuery_prodClassName2(String prodClassName2) {
		this.query_prodClassName2 = prodClassName2;
	}

	public String getQuery_custId() {
		return this.query_custId;
	}

	public void setQuery_custId(String custId) {
		this.query_custId = custId;
	}

	public String getQuery_groupId() {
		return this.query_groupId;
	}

	public void setQuery_groupId(String groupId) {
		this.query_groupId = groupId;
	}

	public String getQuery_name1() {
		return this.query_name1;
	}

	public void setQuery_name1(String name1) {
		this.query_name1 = name1;
	}

	public String getQuery_name2() {
		return this.query_name2;
	}

	public void setQuery_name2(String name2) {
		this.query_name2 = name2;
	}

	public String getQuery_subname1() {
		return this.query_subname1;
	}

	public void setQuery_subname1(String subname1) {
		this.query_subname1 = subname1;
	}

	public String getQuery_subname2() {
		return this.query_subname2;
	}

	public void setQuery_subname2(String subname2) {
		this.query_subname2 = subname2;
	}

	public String getQuery_subname3() {
		return this.query_subname3;
	}

	public void setQuery_subname3(String subname3) {
		this.query_subname3 = subname3;
	}

	public String getQuery_subname4() {
		return this.query_subname4;
	}

	public void setQuery_subname4(String subname4) {
		this.query_subname4 = subname4;
	}

	public String getQuery_tel() {
		return this.query_tel;
	}

	public void setQuery_tel(String tel) {
		this.query_tel = tel;
	}

	public String getQuery_telExt() {
		return this.query_telExt;
	}

	public void setQuery_telExt(String telExt) {
		this.query_telExt = telExt;
	}

	public String getQuery_faxFlag() {
		return this.query_faxFlag;
	}

	public void setQuery_faxFlag(String faxFlag) {
		this.query_faxFlag = faxFlag;
	}

	public String getQuery_sb() {
		return this.query_sb;
	}

	public void setQuery_sb(String sb) {
		this.query_sb = sb;
	}

	public String getQuery_listOrder() {
		return this.query_listOrder;
	}

	public void setQuery_listOrder(String listOrder) {
		this.query_listOrder = listOrder;
	}

	public String getQuery_regionCode() {
		return this.query_regionCode;
	}

	public void setQuery_regionCode(String regionCode) {
		this.query_regionCode = regionCode;
	}

	public String getQuery_regionName() {
		return this.query_regionName;
	}

	public void setQuery_regionName(String regionName) {
		this.query_regionName = regionName;
	}

	public String getQuery_cityCode() {
		return this.query_cityCode;
	}

	public void setQuery_cityCode(String cityCode) {
		this.query_cityCode = cityCode;
	}

	public String getQuery_cityName() {
		return this.query_cityName;
	}

	public void setQuery_cityName(String cityName) {
		this.query_cityName = cityName;
	}

	public String getQuery_destrictCode() {
		return this.query_destrictCode;
	}

	public void setQuery_destrictCode(String destrictCode) {
		this.query_destrictCode = destrictCode;
	}

	public String getQuery_destrictName() {
		return this.query_destrictName;
	}

	public void setQuery_destrictName(String destrictName) {
		this.query_destrictName = destrictName;
	}

	public String getQuery_areaCode() {
		return this.query_areaCode;
	}

	public void setQuery_areaCode(String areaCode) {
		this.query_areaCode = areaCode;
	}

	public String getQuery_addr() {
		return this.query_addr;
	}

	public void setQuery_addr(String addr) {
		this.query_addr = addr;
	}

	public String getQuery_zip() {
		return this.query_zip;
	}

	public void setQuery_zip(String zip) {
		this.query_zip = zip;
	}

	public String getQuery_pyAddr() {
		return this.query_pyAddr;
	}

	public void setQuery_pyAddr(String pyAddr) {
		this.query_pyAddr = pyAddr;
	}

	public String getQuery_engAddr() {
		return this.query_engAddr;
	}

	public void setQuery_engAddr(String engAddr) {
		this.query_engAddr = engAddr;
	}

	public String getQuery_poix() {
		return this.query_poix;
	}

	public void setQuery_poix(String poix) {
		this.query_poix = poix;
	}

	public String getQuery_poiy() {
		return this.query_poiy;
	}

	public void setQuery_poiy(String poiy) {
		this.query_poiy = poiy;
	}

	public String getQuery_custStatus() {
		return this.query_custStatus;
	}

	public void setQuery_custStatus(String custStatus) {
		this.query_custStatus = custStatus;
	}

	public String getQuery_custTypeCode() {
		return this.query_custTypeCode;
	}

	public void setQuery_custTypeCode(String custTypeCode) {
		this.query_custTypeCode = custTypeCode;
	}

	public String getQuery_classMainId() {
		return this.query_classMainId;
	}

	public void setQuery_classMainId(String classMainId) {
		this.query_classMainId = classMainId;
	}

	public String getQuery_orgId() {
		return this.query_orgId;
	}

	public void setQuery_orgId(String orgId) {
		this.query_orgId = orgId;
	}

	public String getQuery_url() {
		return this.query_url;
	}

	public void setQuery_url(String url) {
		this.query_url = url;
	}

	public String getQuery_weibo() {
		return this.query_weibo;
	}

	public void setQuery_weibo(String weibo) {
		this.query_weibo = weibo;
	}

	public String getQuery_weixin() {
		return this.query_weixin;
	}

	public void setQuery_weixin(String weixin) {
		this.query_weixin = weixin;
	}

	public String getQuery_yixin() {
		return this.query_yixin;
	}

	public void setQuery_yixin(String yixin) {
		this.query_yixin = yixin;
	}

	public String getQuery_logo() {
		return this.query_logo;
	}

	public void setQuery_logo(String logo) {
		this.query_logo = logo;
	}

	public String getQuery_safeStatus() {
		return this.query_safeStatus;
	}

	public void setQuery_safeStatus(String safeStatus) {
		this.query_safeStatus = safeStatus;
	}

	public String getQuery_bxName() {
		return this.query_bxName;
	}

	public void setQuery_bxName(String bxName) {
		this.query_bxName = bxName;
	}

	public String getQuery_pyName() {
		return this.query_pyName;
	}

	public void setQuery_pyName(String pyName) {
		this.query_pyName = pyName;
	}

	public String getQuery_engName() {
		return this.query_engName;
	}

	public void setQuery_engName(String engName) {
		this.query_engName = engName;
	}

	public String getQuery_spName() {
		return this.query_spName;
	}

	public void setQuery_spName(String spName) {
		this.query_spName = spName;
	}

	public String getQuery_sourceId() {
		return this.query_sourceId;
	}

	public void setQuery_sourceId(String sourceId) {
		this.query_sourceId = sourceId;
	}

	public String getQuery_prodClassId() {
		return this.query_prodClassId;
	}

	public void setQuery_prodClassId(String prodClassId) {
		this.query_prodClassId = prodClassId;
	}

	public String getQuery_modifyTime() {
		return this.query_modifyTime;
	}

	public void setQuery_modifyTime(String modifyTime) {
		this.query_modifyTime = modifyTime;
	}

	public String getQuery_modifyEmpId() {
		return this.query_modifyEmpId;
	}

	public void setQuery_modifyEmpId(String modifyEmpId) {
		this.query_modifyEmpId = modifyEmpId;
	}

	public String getQuery_inputTime() {
		return this.query_inputTime;
	}

	public void setQuery_inputTime(String inputTime) {
		this.query_inputTime = inputTime;
	}

	public String getQuery_inputEmpId() {
		return this.query_inputEmpId;
	}

	public void setQuery_inputEmpId(String inputEmpId) {
		this.query_inputEmpId = inputEmpId;
	}

	public String getQuery_id() {
		return this.query_id;
	}

	public void setQuery_id(String id) {
		this.query_id = id;
	}

	public String getQuery_source() {
		return this.query_source;
	}

	public void setQuery_source(String source) {
		this.query_source = source;
	}

	public String getQuery_inputEmpCode() {
		return query_inputEmpCode;
	}

	public void setQuery_inputEmpCode(String queryInputEmpCode) {
		query_inputEmpCode = queryInputEmpCode;
	}

	public String getQuery_modifyEmpCode() {
		return query_modifyEmpCode;
	}

	public void setQuery_modifyEmpCode(String queryModifyEmpCode) {
		query_modifyEmpCode = queryModifyEmpCode;
	}
	
	public void setProdGroupService(ProdGroupService prodGroupService) {
		this.prodGroupService = prodGroupService;
	}

	

	public String getQuery_status114yp() {
		return query_status114yp;
	}

	public void setQuery_status114yp(String query_status114yp) {
		this.query_status114yp = query_status114yp;
	}

	public String getQuery_status360() {
		return query_status360;
	}

	public void setQuery_status360(String query_status360) {
		this.query_status360 = query_status360;
	}

	public String getAnyUpdateSelectId() {
		return anyUpdateSelectId;
	}

	public void setAnyUpdateSelectId(String anyUpdateSelectId) {
		this.anyUpdateSelectId = anyUpdateSelectId;
	}

	public String[] getSelectedUpdate() {
		return selectedUpdate;
	}

	public void setSelectedUpdate(String[] selectedUpdate) {
		this.selectedUpdate = selectedUpdate;
	}

	public ProdCustomerService getProdCustomerService() {
		return prodCustomerService;
	}

	public ProdGroupService getProdGroupService() {
		return prodGroupService;
	}

	public String getQuery_operator() {
		return query_operator;
	}

	public void setQuery_operator(String query_operator) {
		this.query_operator = query_operator;
	}

	public String getQuery_startTime() {
		return query_startTime;
	}

	public void setQuery_startTime(String query_startTime) {
		this.query_startTime = query_startTime;
	}

	public String getQuery_endTime() {
		return query_endTime;
	}

	public void setQuery_endTime(String query_endTime) {
		this.query_endTime = query_endTime;
	}

	public String getUploadContentType() {
		return uploadContentType;
	}

	public void setUploadContentType(String uploadContentType) {
		this.uploadContentType = uploadContentType;
	}

	public String getSavePath() {
		return savePath;
	}

	public void setSavePath(String savePath) {
		this.savePath = savePath;
	}

	public File getUpload() {
		return upload;
	}

	public void setUpload(File upload) {
		this.upload = upload;
	}

	public String getUploadFileName() {
		return uploadFileName;
	}

	public void setUploadFileName(String uploadFileName) {
		this.uploadFileName = uploadFileName;
	}

	public Map getKermanTypeMap() {
		return kermanTypeMap;
	}

	public void setKermanTypeMap(Map kermanTypeMap) {
		this.kermanTypeMap = kermanTypeMap;
	}

	public Map getCustStustMap() {
		return custStustMap;
	}

	public void setCustStustMap(Map custStustMap) {
		this.custStustMap = custStustMap;
	}

	public String getQuery_oldTel() {
		return query_oldTel;
	}

	public void setQuery_oldTel(String query_oldTel) {
		this.query_oldTel = query_oldTel;
	}

	public String getQuery_addrId() {
		return query_addrId;
	}

	public void setQuery_addrId(String query_addrId) {
		this.query_addrId = query_addrId;
	}

	public String getQuery_seqId() {
		return query_seqId;
	}

	public void setQuery_seqId(String query_seqId) {
		this.query_seqId = query_seqId;
	}

	public ProdCustomerHisService getProdCustomerHisService() {
		return prodCustomerHisService;
	}

	public void setProdCustomerHisService(
			ProdCustomerHisService prodCustomerHisService) {
		this.prodCustomerHisService = prodCustomerHisService;
	}

	public String getQuery_userName() {
		return query_userName;
	}

	public void setQuery_userName(String query_userName) {
		this.query_userName = query_userName;
	}

	public ProdCustomerUidService getProdCustomerUidService() {
		return prodCustomerUidService;
	}

	public void setProdCustomerUidService(
			ProdCustomerUidService prodCustomerUidService) {
		this.prodCustomerUidService = prodCustomerUidService;
	}

	public ProdCustomerUid getProdCustomerUid() {
		return prodCustomerUid;
	}

	public void setProdCustomerUid(ProdCustomerUid prodCustomerUid) {
		this.prodCustomerUid = prodCustomerUid;
	}

	public String getOrder_name1() {
		return order_name1;
	}

	public void setOrder_name1(String order_name1) {
		this.order_name1 = order_name1;
	}

	public String getOrder_tel() {
		return order_tel;
	}

	public void setOrder_tel(String order_tel) {
		this.order_tel = order_tel;
	}

	public String getOrder_areacode() {
		return order_areacode;
	}

	public void setOrder_areacode(String order_areacode) {
		this.order_areacode = order_areacode;
	}

	public String getOrder_regioncode() {
		return order_regioncode;
	}

	public void setOrder_regioncode(String order_regioncode) {
		this.order_regioncode = order_regioncode;
	}

	public String getOrder_citycode() {
		return order_citycode;
	}

	public void setOrder_citycode(String order_citycode) {
		this.order_citycode = order_citycode;
	}

	public String getOrder_addr() {
		return order_addr;
	}

	public void setOrder_addr(String order_addr) {
		this.order_addr = order_addr;
	}


	
	

}
